<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="commons/tags.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="commons/meta.jsp"%>
<title>悦读管理</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 12;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}

-->
a:hover {
	background-color: white;
}

a:visited {
	color: #C71585;
	background-color: white;
}
</style>
<link rel="stylesheet"
	href="${ctx}/css/themes/jquery-ui-1.8.23.custom.css" />
<script src="${ctx}/js/jquery-1.8.0.min.js"></script>
<script src="${ctx}/js/jquery-ui-1.8.23.custom.min.js"></script>
<script src="${ctx}/js/jquery.ui.datepicker-zh-CN.js"></script>
<script>
	$(function() {
		$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
		$("#startDate").datepicker({
			changeMonth : true,
			changeYear : true,
			showButtonPanel : true
		});
		$("#endDate").datepicker({
			changeMonth : true,
			changeYear : true,
			showButtonPanel : true
		});
		$("#chkall").click(function() {
			$('input[name="yueduId"]').attr("checked", this.checked);
		});
		$("#first").click(function() {
			$("#pageNo").val(1);
			$("#pageForm").submit();
			return false;
		});
		$("#pre").click(function() {
			no = parseInt($("#pageNo").val()) - 1;
			$("#pageNo").val(no);
			$("#pageForm").submit();
			return false;
		});
		$("#next").click(function() {
			no = parseInt($("#pageNo").val()) + 1;
			$("#pageNo").val(no);
			$("#pageForm").submit();
			return false;
		});
		$("#last").click(function() {
			$("#pageNo").val($("#total").val());
			$("#pageForm").submit();
			return false;
		});
		$("#jump").click(function() {
			no = $.trim($("#jumpNo").val());
			if (no == "") {
				alert("请输入正确的页码");
				return false;
			}
			total = parseInt($("#total").val());
			if (no < 1)
				no = 1;
			if (no > total)
				no = total;
			$("#pageNo").val(no);
			$("#pageForm").submit();
			return false;
		});
		$("#delselect").click(function() {
			var ids = $("input[name='yueduId']:checked").length;
			if (ids > 0) {
				$("#pageForm").attr("action", "${ctx}/yuedu/delete");
				$("#pageForm").submit();
			} else {
				alert("请选择要删除的内容");
			}
			return false;
		});
	});
	function showCommentDialog(yueduId) {
		$("<iframe id=\"comment_dialog\" title=\"评论管理\" src=\"${ctx}/yuedu_comment/queryPage?yueduId="+yueduId+"\"></iframe>").dialog({
			modal : true,
			height : 400,
			width : 1024,
		}).width(1024-30).height(400-30);
	}
	function del(id) {
		$('input[name="yueduId"]').attr("checked", false);
		$("#delId").val(id);
		$("#pageForm").attr("action", "${ctx}/yuedu/delete");
		$("#pageForm").submit();
		return false;
	}
</script>
</head>

<body>
	<table width="100%" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<td><table cellspacing="2">
					<tr>
						<td><form action="${ctx}/yuedu/queryPage" method="post">
								<span class="STYLE10">关键字（标题、简介、内容）：<input type="text"
									id="keyWord" name="keyWord" value="${keyWord}" /></span><span
									class="STYLE10">发布时间 从：<input type="text" id="startDate"
									name="startDate" readonly="true" /> 至 <input type="text"
									id="endDate" name="endDate" readonly="true" />
								</span><span style=""> <input type="submit" value="搜索" />
								</span>
							</form></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td height="24" bgcolor="#353c44"><table width="100%"
								border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td><table width="100%" border="0" cellspacing="0"
											cellpadding="0">
											<tr>
												<td width="6%" height="19" valign="bottom"><div
														align="center">
														<img src="images/tb.gif" width="14" height="14" />
													</div></td>
												<td width="94%" valign="bottom"><span class="STYLE1">
														管理人员基本信息列表</span></td>

											</tr>
										</table></td>
									<td><div align="right">
											<span class="STYLE1"><img src="${ctx}/images/add.gif"
												width="10" height="10" /> <a href="${ctx}/yuedu_add">添加</a>
												&nbsp; <img src="${ctx}/images/del.gif" width="10"
												height="10" /> <a href="" id="delselect">删除</a>
												&nbsp;&nbsp; </span><span class="STYLE1"> &nbsp;</span>
										</div></td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td>
				<form id="pageForm" name="pageForm" action="${ctx }/yuedu/queryPage"
					method="post">
					<input type="hidden" id="pageNo" name="pageNo"
						value="${info.pageNum }" /> <input type="hidden" id="keyWord"
						name="keyWord" value="${keyWord}" /> <input type="hidden"
						id="startDate" name="startDate" value="${startDate}" /> <input
						type="hidden" id="endDate" name="endDate" value="${endDate}" /> <input
						type="hidden" id="delId" name="yueduId" />
					<table width="100%" border="0" cellpadding="0" cellspacing="1"
						bgcolor="#a8c7ce">
						<tr>
							<td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div
									align="center">
									<input type="checkbox" id="chkall" name="chkall" />
								</div></td>
							<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">文章标题</span>
								</div></td>
							<td width="25%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">文章简介</span>
								</div></td>
							<td width="7%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">权重</span>
								</div></td>
							<td width="16%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">发布时间</span>
								</div></td>
							<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">发布者</span>
								</div></td>
							<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">基本操作</span>
								</div></td>
						</tr>
						<c:forEach var="yuedu" items="${info.dataArray}">
							<tr>
								<td height="20" bgcolor="#FFFFFF"><div align="center">
										<input type="checkbox" name="yueduId" id="yueduId"
											value="${yuedu.yueduId}" />
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE6"><div
										align="center">
										<span class="STYLE19">${yuedu.title}</span>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">${yuedu.jianjie}</div></td>

								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">${yuedu.weight}</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<fmt:formatDate value="${yuedu.publishdate}"
											pattern="yyyy-MM-dd hh:mm:ss" />
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">${yuedu.username}</div></td>
								<td height="20" bgcolor="#FFFFFF"><div align="center"
										class="STYLE21">
										<a href="#" onclick="del(${yuedu.yueduId})">删除</a> | <a
											href="${ctx}/yuedu/edit_view?id=${yuedu.yueduId}">修改</a> | <a
											href="#" onclick="showCommentDialog(${yuedu.yueduId})">评论</a>
									</div></td>
							</tr>
						</c:forEach>
					</table>
				</form>
			</td>
		</tr>
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td width="33%"><div align="left">
								<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>
										${info.pageCount }</strong> 条记录，当前第<strong>${info.pageNum}</strong> 页，共
									<strong>${info.pageTotal }</strong> 页
								</span>
							</div></td>
						<td width="67%">
							<table width="312" border="0" align="right" cellpadding="0"
								cellspacing="0">
								<tr>
									<td width="49"><div align="center">
											<span class="STYLE22"> <c:if var="first"
													test="${info.pageNum le 1 }">
														首页
											</c:if> <c:if test="${not first}">
													<a id="first" href="">首页</a>
												</c:if></span>
										</div></td>
									<td width="49"><div align="center">
											<span class="STYLE22"> <c:if var="pre"
													test="${info.pageNum gt 1 }">
													<a id="pre" href="">上一页</a>
												</c:if> <c:if test="${not pre }">
												上一页
												</c:if>
											</span>
										</div></td>
									<td width="49"><div align="center">
											<span class="STYLE22"> <c:if var="next"
													test="${info.pageNum lt info.pageTotal }">
													<a id="next" href="">下一页</a>
												</c:if> <c:if test="${not next }">
												下一页
												</c:if>
											</span>
										</div></td>
									<td width="49"><div align="center">
											<span class="STYLE22"> <c:if var="last"
													test="${info.pageNum ge info.pageTotal }">
														尾页
													</c:if> <c:if test="${not last }">
													<a id="last" href="">尾页</a>
												</c:if></span>
										</div></td>
									<td width="37" class="STYLE22"><div align="center">转到</div></td>
									<td width="22"><div align="center">
											<input type="text" name="jumpNo" id="jumpNo"
												onkeyup="value=value.replace(/[^\d]/g,'')"
												onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
												style="width: 20px; height: 12px; font-size: 12px; border: solid 1px #7aaebd;" />
										</div></td>
									<td width="22" class="STYLE22"><div align="center">页</div></td>
									<td width="35"><span class="STYLE22"><a id="jump"
											href="">GO</a></a></span></td>
								</tr>
							</table>
						</td>
					</tr>
				</table></td>
		</tr>
	</table>

</body>
</html>
